package mock.servicesdirectory.contacts.web.action;

import java.util.ArrayList;
import java.util.List;

import javax.xml.ws.Action;

import mock.servicesdirectory.contacts.business.businessinterface.ContactBo;
import mock.servicesdirectory.contacts.dao.daoimpl.ContactDaoImpl;
import mock.servicesdirectory.contacts.web.model.ContactModel;

import com.opensymphony.xwork2.ActionSupport;

public class TestAction extends ActionSupport {
	private String firstName;
	private ContactBo contactBo;
	private List<ContactModel> contacts;
	
	public String execute(){		
		/*List<mock.servicesdirectory.common.entities.Contact> listContact = 
				getContactBo().getContacts("", "", true);
						
				
		contacts = new ArrayList<ContactModel>();
		ContactModel item;
		for (mock.servicesdirectory.common.entities.Contact c : listContact) {
			item = new ContactModel();			
			item.setContactName(c.getContactId() + c.getContactType());
			item.setMobilePhone(c.getMobilePhone());
			item.setEmail(c.getEmail());
			item.setContactType(c.getContactType());
			contacts.add(item);
		}							
				
		firstName = contacts.get(0).getEmail();*/
		return SUCCESS;
	}
	
	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}
	

	/**
	 * @return the contactBo
	 */
	public ContactBo getContactBo() {
		return contactBo;
	}

	/**
	 * @param contactBo the contactBo to set
	 */
	public void setContactBo(ContactBo contactBo) {
		this.contactBo = contactBo;
	}

	/**
	 * @return the contacts
	 */
	public List<ContactModel> getContacts() {
		return contacts;
	}

	/**
	 * @param contacts the contacts to set
	 */
	public void setContacts(List<ContactModel> contacts) {
		this.contacts = contacts;
	}

}
